package com.example.lirisheng.springbootfinalexperiment.repositories;


import com.example.lirisheng.springbootfinalexperiment.entity.RecordTemperature;
import com.example.lirisheng.springbootfinalexperiment.entity.Users;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.sql.Date;
import java.util.List;

public interface RecordTemperatureRepository extends CrudRepository<RecordTemperature,Integer> {

    public List<RecordTemperature> findByResId(Long resId);

    @Modifying
    @Query(value = "insert into record_temperature(date, temperature,res_id) values (?1,?2,?3)",nativeQuery = true)
    public void mysave(Date date, Double temperature, Integer resId);
}
